<template>
  <div id="app">
    <router-view/>
    <!--footer-->
    <Tabbar v-show="isNav" style="height: 55px"></Tabbar>
  </div>
</template>

<script>
import Tabbar from '@/components/Tabbar'
export default {
  components: {
    Tabbar
  },
  data () {
    return {
      isNav: false // 控制底部导航栏的显示与隐藏
    }
  },
  created () {
    // 控制底部导航栏的显示与隐藏
    let isNav = this.$route.meta.isNav
    this.isNav = isNav
  },
  watch: { // 监听路由事件
    $route (to, from) {
      // 控制底部导航栏的显示与隐藏
      let isNav = to.meta.isNav
      this.isNav = isNav
    }
  }
}
</script>

<style lang="less">
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
#nav {
  padding: 30px;
  a {
    font-weight: bold;
    color: #2c3e50;
    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
